#include <bits/stdc++.h>
using namespace std;
#define mm(a) memset(a,0,sizeof(a));
 
int main () {
    int n2 = 0, n5 = 0;
    for (int i = 0; i < 100; i++) {
        int x; 
        cin >> x;
        while (x && x % 2 == 0) {
            n2++;
            x /= 2;
        }
        while (x && x % 5 == 0) {
            n5++;
            x /= 5;
        } 
    }
    cout << min(n2, n5) << endl;
    return 0;
}